import CTextAreaForm from '@/components/CTextAreaForm/CTextAreaForm'
import CSelectFormItem from '@/components/CSelectFormItem/CSelectFormItem'
import useEffectDictPage from '@/useEffect/useEffectDictPage'
import { Col, Form } from '@douyinfe/semi-ui'
import { OptionProps } from '@douyinfe/semi-ui/lib/es/select'

// 获取 下拉选的数据
export function getBulletinFormSelectData(modalVisible: boolean) {
  const { dictList } = useEffectDictPage(modalVisible, 'bulletin_type')
  return { dictList }
}

interface IBulletinFormItem {
  dictList: OptionProps[]
}

export default function BulletinFormItem(props: IBulletinFormItem) {
  return (
    <>
      <Col span={24}>
        <CSelectFormItem
          field="type"
          label="公告类型"
          optionList={props.dictList}
          required
        ></CSelectFormItem>
      </Col>
      <Col span={24}>
        <Form.Input
          field="title"
          showClear
          rules={[{ required: true, message: '请输入标题' }]}
          label="标题"
        />
      </Col>
      <Col span={24}>
        <Form.DatePicker
          className="w100"
          field="sendTime"
          rules={[{ required: true, message: '请选择发布时间' }]}
          type="dateTime"
          placeholder={' '}
          label="发布时间"
        />
      </Col>
      <Col span={24}>
        <CTextAreaForm
          required
          field="content"
          label="公告内容"
          maxCount={0}
          rows={3}
        ></CTextAreaForm>
      </Col>
      <Col span={24}>
        <CTextAreaForm></CTextAreaForm>
      </Col>
    </>
  )
}
